<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored ="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>添加联系人</title>
<script type="text/javascript">
	$(function () {
		$('#contactName').focus(function(){
			if(String($(this).val())=='姓名'){
				$(this).val('');
			}
		}).blur(function(){
			if(String($(this).val())==''){
				$(this).val('姓名');
			}
		});
		$('#contactUnit').focus(function(){
			if(String($(this).val())=='单位名称'){
			$(this).val('').blur(function(){
				if(String($(this).val()).length==0){
				$(this).val('单位名称');
					}
				});
			}
		});
		$('#unitPost').focus(function(){
			if(String($(this).val())=='职务名称'){
			$(this).val('').blur(function(){
				if(String($(this).val()).length==0){
				$(this).val('职务名称');
					}
				});
			}
		});
		$('#unit').focus(function(){
			if(String($(this).val())=='党派名称'){
			$(this).val('').blur(function(){
				if(String($(this).val()).length==0){
				$(this).val('党派名称');
					}
				});
			}
		});
		$('#position').focus(function(){
			if(String($(this).val())=='职务名称'){
			$(this).val('').blur(function(){
				if(String($(this).val()).length==0){
				$(this).val('职务名称');
					}
				});
			}
			});
		$("#contacttype").change(function(){
			var type = $("#contacttype").val();
			if(type == '1237'){
				$("#systemOut").hide();
				$("#systemIn").show();
				$("#positionId").attr("disabled","");
			}else{
				$("#systemIn").hide();
				$("#systemOut").show();
				$("#positionId").attr("disabled","disabled");
			}
		});
	});
</script>
</head>
<body>
	<div style="margin:10px;">
	<form action="" method="post" id="addContactForm">
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="InnerTable">
		    <tr>
		      <td width="170">
		        <select id="contacttype" name="contact.contactType">
					<option value="1237">政府系统内</option>
					<option value="1238">政府系统外</option>
				</select>
			  </td>
              <td>&nbsp;</td>
           </tr>
		</table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" class="InnerTable">
                <tr valign="top">
                    <td width="150">
                    	<input type="text" id="contactName" name="contactName" maxlength="5" class="shadow single-cell" value="姓名" />
                    </td>
                    <td>
                    	&nbsp;<span class="note">*</span>&nbsp;&nbsp;&nbsp;
                        <select id="sex" name="contact.contactSex">
							<option value="1031">男</option>
							<option value="1032">女</option>
						</select>
                    </td>
                    <td>&nbsp;</td>
                </tr>
          </table>
          <table width="100%" id="systemIn" border="0" cellspacing="0" cellpadding="0" class="InnerTable">
                  <tr valign="top">
                  		<td width="170">
                  			<input type="text" id="contactUnitName" class="shadow single-cell" value="单位名称" readonly="readonly"/>
                  		</td>
                   	 	<td width="100">
                   	 		<select id="positionId" name="positionId">
                   	 			<option value="">请选择</option>
                   	 		</select>
                   	 	</td>
                   	 	<td>&nbsp;</td>
                  </tr>
                  <tr valign="top">
                    <td width="170">职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;级：
                    	<select name="contact.contactJobClass">
                    	   	<c:forEach items="${contactJobClassList}" var="contactJobClass">
                   	 			<option value="${contactJobClass.dataValueId }">${contactJobClass.value }</option>
                   	 		</c:forEach>
                    	</select>
                    </td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
          </table>
          <table width="100%" id="systemOut" style="display:none;" border="0" cellspacing="0" cellpadding="0" class="InnerTable">       
                  <tr valign="top"> 
                    <td width="170">工作单位及职务名称：</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr valign="top">
                    <td width="170"><input type="text" id="contactUnit" maxlength="50" class="shadow single-cell" name="contact.contactUnit" value="单位名称" /></td>
                    <td><input type="text" class="shadow single-cell" style="width: 80px;" maxlength="50" id="unitPost" name="contact.unitPost" value="职务名称" /></td>
                  </tr>
                  <tr valign="top">
                    <td width="170">党派及社会兼职：</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr valign="top">
                    <td width="170"><input id="unit" maxlength="50" name="contactPartTime.unit" type="text" class="shadow single-cell" value="党派名称" /></td>
                    <td><input type="text" id="position" maxlength="50" name="contactPartTime.position" class="shadow single-cell" style="width: 80px;" value="职务名称" /></td>
                  </tr>  
        </table>         
          
          <table width="100%" border="0" cellspacing="0" cellpadding="0" class="InnerTable">
                  <tr valign="top">
                    <td width="240">个人分组：
                    	<select id="contactGroupId" name="contactGroupId">
                    		<c:forEach items="${personalGroupList}" var="personalGroup">
                    			<option value="${personalGroup.groupId }">${personalGroup.groupName }</option>
                    		</c:forEach>
                    	</select>
                    </td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr valign="top">
                    <td width="170">政治面貌：
                    	<select name="contact.contactPoliticalStatus">
                    		<c:forEach items="${contactPoliticalStatusList}" var="contactPoliticalStatus">
                    			<option value="${contactPoliticalStatus.dataValueId }">${contactPoliticalStatus.value }</option>
                    		</c:forEach>
                    	</select>
                    </td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr valign="top">
                    <td width="170">民&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;族：
                    	<select name="contact.contactNational">
                    		<c:forEach items="${contactNationalList}" var="contactNational">
                    			<option value="${contactNational.dataValueId }">${contactNational.value }</option>
                    		</c:forEach>
                    	</select>
                    </td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                  	<td>&nbsp;</td>
                  	<td>&nbsp;</td>
                  </tr>
					<tr valign="top">
						<td width="240">移动电话：<input type="text" maxlength="20" id="contactMobile" class="shadow single-cell"
							name="contact.contactMobile"></input></td>
						<td>&nbsp;</td>
					</tr>
					<tr valign="top">
						<td>住宅电话：<input type="text" maxlength="20"  id="homePhone" class="shadow single-cell"
							name="contact.homePhone"></input></td>
						<td>&nbsp;</td>
					</tr>
					<tr valign="top">
						<td>单位电话：<input type="text" maxlength="20"  id="officePhone" class="shadow single-cell"
							name="contact.officePhone"></input></td>
						<td>&nbsp;</td>
					</tr>
					<tr valign="top">
						<td>传真电话：<input type="text"  maxlength="20" id="contactFax" class="shadow single-cell"
							name="contact.contactFax"></input></td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td width="240">电子邮件：<input type="text" maxlength="30" name="contact.email" class="shadow single-cell"/></td>
						<td>&nbsp;</td>
					</tr>
					<tr valign="top">
						<td>单位地址：<input type="text" maxlength="100" id="officeAddress" class="shadow single-cell"
							name="contact.officeAddress"></input></td>
						<td>&nbsp;</td>
					</tr>
					<tr valign="top">
						<td  width="240">单位邮编：<input type="text" maxlength="6" id="officeCode" class="shadow single-cell"
							name="contact.officeCode"></input></td>
						<td>&nbsp;</td>
					</tr>
					<tr valign="top">
						<td>家庭地址：<input type="text" maxlength="100" id="homeAddress" class="shadow single-cell"
							name="contact.homeAddress"></input></td>
						<td>&nbsp;</td>
					</tr>
					<tr valign="top">
						<td width="240">家庭邮编：<input type="text" maxlength="6" id="homeCode" class="shadow single-cell"
							name="contact.homeCode"></input></td>
						<td>&nbsp;</td>
					</tr>
					<tr valign="top">
						<td>其它地址：<input type="text" maxlength="100" id="otherAddress" class="shadow single-cell"
							name="contact.otherAddress"></input></td>
						<td>&nbsp;</td>
					</tr>
					<tr valign="top">
						<td width="240">其它邮编：<input type="text" maxlength="6" id="otherCode" class="shadow single-cell"
							name="contact.otherCode"></input></td>
						<td>&nbsp;</td>
					</tr>
				  	<tr valign="top">
						<td width="240">生&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;日：<input type="text" id="birthDate"
						name="contact.birthDate" class="use-datepicker datepicker-low shadow single-cell"
						onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:true,readOnly:true})"/>
						</td>
						<td>&nbsp;</td>
					</tr>
                  <tr>
                    <td width="170">备注：</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td colspan="2"><textarea name="contact.content" class="clean-html shadow nf-double-cell"></textarea></td>
                  </tr>
                  <tr>
                    <td width="170">&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="170">&nbsp;</td>
                    <td>
                      <button id="saveContactSubmit" type="submit" class="btn_green_outline">确定</button>
                    </td>
                  </tr>
                </table>
			</form>
        </div>
</body>
</html>